//
//  AMYestodayListCell.m
//  CBT
//
//  Created by apple on 2019/6/25.
//  Copyright © 2019 Mr.Zhang. All rights reserved.
//

#import "AMYestodayListCell.h"

@implementation AMYestodayListCell

+ (instancetype)createTableView:(UITableView *)tableView {
    AMYestodayListCell *cell = [tableView dequeueReusableCellWithIdentifier:@"CELL"];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    
    [cell makeViews];
    
    return cell;
}

- (void)makeViews {
    
    CGFloat width1_2 = (SCREEN_WIDTH-40)/2.0;
    
    [self.contentView addSubview:self.coinNameLabel];
    [self.coinNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(20);
        make.top.mas_equalTo(20);
        make.height.mas_equalTo(20);
        make.width.mas_equalTo(width1_2);
    }];
    
    [self.contentView addSubview:self.dateLabel];
    [self.dateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-20);
        make.top.mas_equalTo(30);
        make.width.mas_equalTo(width1_2);
        make.height.mas_equalTo(20);
    }];
    
    [self.contentView addSubview:self.amountLabel];
    [self.amountLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-20);
        make.top.mas_equalTo(10);
        make.height.mas_equalTo(20);
        make.width.mas_equalTo(width1_2);
    }];
    
    
    
}


- (UILabel *)coinNameLabel {
    if (!_coinNameLabel) {
        _coinNameLabel = [[UILabel alloc] init];
        _coinNameLabel.textColor = [UIColor lightGrayColor];
        _coinNameLabel.font = [UIFont systemFontOfSize:12];
        _coinNameLabel.text = @"PC";
    }
    
    return _coinNameLabel;
}

- (UILabel *)dateLabel {
    if (!_dateLabel) {
        _dateLabel = [[UILabel alloc] init];
        _dateLabel.textColor = [UIColor darkTextColor];
        _dateLabel.font = [UIFont systemFontOfSize:12];
        _dateLabel.textAlignment = NSTextAlignmentRight;
        _dateLabel.text = @"--";
    }
    
    return _dateLabel;
}

- (UILabel *)amountLabel {
    if (!_amountLabel) {
        _amountLabel = [[UILabel alloc] init];
        _amountLabel.textColor = [UIColor redColor];
        _amountLabel.font = [UIFont systemFontOfSize:12];
        _amountLabel.text = @"+0.00";
        _amountLabel.textAlignment = NSTextAlignmentRight;
    }
    
    return _amountLabel;
}

@end
